package com.ruoyi.api.controller;


import cn.com.jit.tsa.client.TSAType;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Objects;

@RestController
@RequestMapping("/api")
public class ApiController {

    private static final Logger log = LoggerFactory.getLogger(ApiController.class);


    @Autowired
    private ServerConfig serverConfig;

    /**
     * 生成验证码
     */
    @GetMapping("/test")
    public AjaxResult getCode(HttpServletRequest request, HttpServletResponse response) throws IOException
    {

        { // 测试代码
            System.out.println(TSAType.RFC_2630);
        }

        String url = serverConfig.getUrl();
        return AjaxResult.success((Object) url);
    }
}
